﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BE;
using DAL;
using BE.SearchCriteria;

namespace BLL
{
    public class ZonaBLL : BaseBLL
    {
        public static List<ZonasBE> SeleccionarTodos(BaseSC pZonaSC, int pPageSize, int? pPageNum, ref int pCountReg)
        {
            ZonaDAL oZonaDAL = new ZonaDAL();
            return oZonaDAL.SeleccionarPorParametros(pZonaSC, pPageSize, pPageNum, ref pCountReg);
        }


        public static void Insertar(ZonasBE pElemBE)
        {
            try
            {
                Validar(pElemBE);

                ZonaDAL oZonaDAL = new ZonaDAL();
                oZonaDAL.Insertar(pElemBE);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }

        public static void Modificar(ZonasBE pElemBE)
        {
            try
            {
                Validar(pElemBE);

                ZonaDAL oZonaDAL = new ZonaDAL();
                oZonaDAL.Modificar(pElemBE);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }

        public static void Delete(int pIdZona)
        {
            try
            {
                ZonaDAL oZonaDAL = new ZonaDAL();
                oZonaDAL.Delete(pIdZona);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }

        private static void Validar(ZonasBE pElemBE)
        {

        }


    }
}
